﻿     /************鼠标移动重要提示  开始*****************/
        var moveable = false;
		var x0;
        var y0;
        var x1;
        var y1;
		var bodyWidth;
		var bodyHeight;
		var MasterdivID="messagediv";
        var ContentdivID;

        function startgrap(obj)
        {        
            if(event.button==1)
            {
				document.getElementById(obj).setCapture();            //记录鼠标和层位置;
				x0 = event.clientX;
				y0 = event.clientY;
				x1 = parseInt(document.getElementById(obj).style.left);
				y1 = parseInt(document.getElementById(obj).style.top);
                moveable = true; 
 			    //document.getElementById("dv1").innerHTML="<b>start</b><P>X0="+x0+" y0="+y0+"  x1="+x1+"  y1="+y1+" obj.style.top="+document.getElementById(obj).style.top+"</P>";      
            }
         }
        function stopgrap(obj)
        {
            if(moveable)
            {
                document.getElementById(obj).releaseCapture();//用来释放对鼠标的捕捉
                moveable = false;
            }
        }
        function grap(obj)
        {
             if(moveable)
             {  

			    divLeft=x1 + event.clientX - x0<0?0:x1 + event.clientX - x0;
                divTop=y1 + event.clientY - y0<0?0:y1 + event.clientY - y0;

                
				document.getElementById(obj).style.left=divLeft;
				document.getElementById(obj).style.top =divTop;
            }
            stopFlash();    //边框停止闪烁
        }
      /************鼠标移动重要提示  结束*****************/   
      
      
      
      	//关闭重要提示
		function closeDIV()
		{
		    stopFlash();  //边框停止闪烁
		    document.getElementById(MasterdivID).style.display="none";
		}
		
		
        //重要提示框定位(默认是网页右下角)
        function SetMessageLacation()
		{
		  //bodyWidth=document.body.clientWidth;
		  //bodyHeight=document.body.clientHeight;


		  bodyHeight=window.document.body.offsetHeight-60;     //返回当前网页高度   
          bodyWidth=window.document.body.offsetWidth-20;
		  //alert(document.body.offsetHeight +"  "+document.body.offsetWeight);
		  //alert(bodyWidth +"  "+bodyHeight);

		  objdiv=document.getElementById(MasterdivID)

		  //alert(bodyWidth+"  "+objdiv.style.width);
          //alert(bodyHeight+"   "+objdiv.style.height);

		  if(bodyWidth>parseInt(objdiv.style.width))
		  {
		      objdiv.style.top=bodyHeight-parseInt(objdiv.style.height);
		  }else
		  {
              objdiv.style.top=0;
		  }

		  if(bodyHeight>parseInt(objdiv.style.height))
		  {
		     objdiv.style.left=bodyWidth-parseInt(objdiv.style.width);
		  }else
		  {
		     objdiv.style.left=0;
		  }

		}
        
		
		//在提示框中显示信息
		function ListMessageInDiv(contentHtml)
		{
		    //alert(document.getElementById(contentId));
		    
		    document.getElementById(ContentdivID).innerHTML=contentHtml;
		}
		
		//展开或收缩节点
		function OpenOrClose(trid)
		{
		    disType=document.getElementById(trid).style.display;
		    disType=disType=="none"?"block":"none";
		    document.getElementById(trid).style.display=disType;
		}
		
		//显示提示框
		function ShowMessageDiv(divID,divWidth,divHeight)
		{
		    ContentdivID=divID
		    divWidth=parseInt(divWidth);
		    divHeight=parseInt(divHeight);
		    
    	    if(divWidth<400)   //定义默认宽度 400px
		    {
		       divWidth=400;
		    }
		    
		    if(divHeight<234)   //定义默认高度 234
		    {
		       divHeight=234;
		    }
		    
		    ContentDivWidth=divWidth-198;   //信息显示范围的宽度
		    ContentDivHeight=divHeight-34;   //信息显示范围的高度

           		    
            document.write("<div id='"+MasterdivID+"'  style=\"display:block;position:absolute;border:3px ridge #CCFFFF;cursor:hand;width:"+divWidth+"px;height:"+divHeight+"px;left:0px;top:50px;background-color:#99CCCC;\"  onmousedown=\"javascript:startgrap('"+MasterdivID+"');\" onmouseout=\"javascript:initFlash();\" onmouseup=\"javascript:stopgrap('"+MasterdivID+"');\" onmousemove=\"javascript:grap('"+MasterdivID+"');\">");
            document.write("<table border=\"0\" style=\"width:100%;\" cellspacing=\"0\" cellpadding=\"0\">");
            document.write("<tr style=\"background-color:#0033CC;height:3px;\"><td colspan=\"5\" ></td></tr>");
            document.write("<tr style=\"height:34px;\">");
            document.write("<td style=\"width:4px;\"><img src=\"../images/intro_left.gif\"/></td>");
            document.write("<td style=\"width:150px;\" style=\"font-size: 14px;color:#226093;text-align:center;font-weight: bold;background-image: url(../images/intro_wordbg.jpg);\">重要提示</td>");
            document.write("<td style=\"width:34px;\" background=\"../images/intro_bg.gif\"><img src=\"../images/intro_right.jpg\"/></td>");
            document.write("<td style=\"width:"+ContentDivWidth+"px;\" background=\"../images/intro_bg.gif\"></td>");
            document.write("<td style=\"width:10px;\" background=\"../images/intro_bg.gif\" align=\"center\"><img src=\"../images/close.gif\" align=\"center\" onclick=\"javascript:closeDIV('"+MasterdivID+"');\"/>&nbsp;</td>");
            document.write("</tr>");
            document.write("<tr style=\"background-color:#CCCCFF;height:3px;\"><td colspan=\"5\" ></td></tr>");
            document.write("<tr>");
            document.write("<td colspan=\"5\">");
            document.write("<div id='"+ContentdivID+"' name='"+ContentdivID+"' style=\"background-color:#99CCCC;width:100%;height:"+ContentDivHeight+"px;margin-top:20px;margin-bottom:20px;margin-left:10px;margin-right:10px;font-size:15px;font-weight:bold;text-decoration:blink;\">");
            //document.write("好久没有你的信好久没有人陪我谈心怀念你柔情似水的眼睛那是我天空最美丽的星星异乡的午夜特别冷清一个男人和一颗热切的信不知道远方的你是否能感应");
            document.write("</div>");
            document.write("</td>");
            document.write("</tr>");
            document.write("</table>");
            document.write("</div>");
            
            initFlash();  //边框开始闪烁
	    }
	    
	    var timeoutProcess;
	    function initFlash()
	    {
	       divborder=document.getElementById(MasterdivID).style.border=="#ccffff 3px ridge"?"#FF0000 3px ridge":"#ccffff 3px ridge";
	       //alert("--"+document.getElementById(MasterdivID).style.border+"--");
	       document.getElementById(MasterdivID).style.border=divborder;
	       timeoutProcess=setTimeout("initFlash()", 500);
	    }
	    
	    function stopFlash()
	    {
	        clearTimeout(timeoutProcess);
            document.getElementById(MasterdivID).style.border="#ccffff 3px ridge";
	    }




